import { Controller, Get, HttpCode, Query, } from '@nestjs/common';
import { NoticeService } from './notice.service';
import { ApiResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
import { GetNoticeDto } from 'src/modules/admin/notice/dto/notice.dto';
import { NoticeResult } from 'src/modules/admin/notice/entities/notice.entity';

@ApiTags('公告')
@Controller('home/notice')
export class NoticeController {
  constructor(private readonly noticeService: NoticeService) { }

  /** 公告 */
  @HttpCode(200)
  @Get('/getNoticeList')
  @ApiResponse({
    status: 200,
    description: '公告列表',
    type: NoticeResult,
  })
  @ApiOperation({
    tags: ['获取公告'],
    summary: '获取公告',
    operationId: 'getNoticeList',
  })
  getNoticeList(@Query() params: GetNoticeDto) {
    return this.noticeService.getNoticeList(params);
  }
}
